<template>
  <view class="mine">
    <view class="userinfo">
      <view class="avatar"><image class="img" src="../../static/logo.png" mode="widthFix"></image></view>
      <view>456</view>
    </view>
    <view class="layout">
      <button type="warn" @click="layout">退出</button>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {

      }
    },
    methods: {
      layout() {
        uni.getStorageSync('uni_id_token')
        console.log(uni.getStorageSync('uni_id_token'))
        uniCloud.callFunction({
          name: 'layout',
          data: {uni_id_token:uni.getStorageSync('uni_id_token')},
          success(res) {
            uni.removeStorageSync('uni_id_token')
            uni.removeStorageSync('uni_id_token_expired')
            console.log(res)
            uni.navigateTo({
              url: '../start/start',
            });
          }
        })
      }
    }
  }
</script>

<style scoped lang="scss">
  .mine {
    width: 100vw;
    height: 100vh;
    box-sizing: border-box;
    padding-top: 30px;
    .userinfo{
      width: 100vw;
      height: 25vh;
      background-color: #007AFF;
      display: flex;
      .avatar{
        width: 30vw;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: 30px;
        .img{
          width: 100%;
          height: 100%;
          border-radius: 50% !important;
        }
      }
    }
  }
</style>
